In computer programming, certain sets of functions may be related. In other words, for a given set of functions, the calculation for each member function of the set may be substantially identical. An example is a set of trigonometric functions, i.e., sine, cosine, tangent, cotangent, secant, and cosecant. Each trigonometric member function may be computed by first performing an argument reduction and some preliminary calculations. The argument reduction and the preliminary calculations are common to each trigonometric member function of the set. To calculate each respective member function, unique instructions are executed after performing the argument reduction and preliminary calculation.
Normally, when a conventional compiler encounters multiple trigonometric function statements in a program, a separate function call is made for each encountered trigonometric function. Thus, for example, if the conventional compiler encounters sin(theta) and cos(theta) statements within a program, two separate function calls are made, with each call executing all of the common instructions.
As an illustration, assume that the following statements appear in a computer program:    X=sin(theta);    Y=cos(theta);
The conventional compiler typically makes the following calls:    R1=call _sin(theta);    R2=call _cos(theta);
As noted above, many of the instructions to perform sine and cosine calculations are identical. For example, on the assignee's IA-64 computer architecture, each trigonometric function takes approximately 50 instructions to compute the respective function. Of these, approximately 48 instructions are identical for sine and cosine functions (the tangent function may also have the identical 48 instructions). This indicates that approximately two instructions are unique for the sine and cosine functions (tangent function requires approximately 12 unique instructions).
With the conventional compiler, as many as 100 instructions are performed to calculate the sine and cosine values. However, as many as 48 instructions are performed twice. This lengthens the execution time and the compiled program size. This penalty is multiplied as more member functions from the same family of functions are called, which causes the common instructions to be executed repeatedly by the running program.
Alternatively, special functions are available, which return all member functions (or most commonly used members) of a related family of functions. However, these special functions are typically non-standard. Accordingly, a programmer must know the names of the special functions to invoke and extract values of interest from the resultant computation. While special function calls may increase speed of execution, programs written with such special function calls suffer from non-portability. In other words, the programs become architecture specific and/or operating system specific.